
import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_hotwork/bean/BaseBean.dart';
import 'package:flutter_hotwork/bean/tongxunlubean.dart';
import 'package:flutter_hotwork/homepage/BaseTitleBar.dart';
import 'package:flutter_hotwork/homepage/BaseViewBar.dart';
import 'package:flutter_hotwork/utils/DioUtils.dart';
import 'package:flutter_hotwork/xunjian/XunJianPointRecord2.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';

import '../Myapplication.dart';
import '../Toast.dart';
import 'XunJianMap.dart';
import 'XunJianPointRecord.dart';
import 'XunJianTaskList.dart';
var firstrefresh =0;
tongxunlubean txbean;
List<Records> searchbean = new List();
class XunJianControlScreen extends StatefulWidget {
  @override
  XunJianControlState createState() => new XunJianControlState();


}

class XunJianControlState extends State<XunJianControlScreen> {



  final textEditingController = TextEditingController();
  @override
  Widget build(BuildContext context) {

    ScrollController controller = ScrollController();

    textEditingController.addListener(() {
    print('input:${textEditingController.text}');

    searchbean.clear();
    for(int i = 0;i<txbean.records.length;i++){
        if(txbean.records[i].realname.contains(textEditingController.text)){
          searchbean.add(txbean.records[i]);
        }
    }
    setState(() {

    });
    });
    double rpx = MediaQuery
        .of(context)
        .size
        .width / 750;
    return Scaffold(

      appBar: new BaseViewBar(
          childView: new BaseTitleBar(
            "巡检",
            leftIcon: '',
            rightIcon: "",
            rightClick: () {
              print("点击了右边干嘛啊。。。哦");
            },
            leftClick: () {
              print("点击了左边干嘛啊。。。哦");
            },
          ),
          preferredSize: Size.fromHeight(50.0)),
      body:
          Container(
        child:
        Container(
          height: 80,
          child:  Row(
            children: [
              InkWell(
                onTap: (){
                  Navigator.push(context, MaterialPageRoute(builder: (context) {
                    return new XunJianListScreen();
                  }));
                },
                child:
                Container(
                  width: 80,
                  child:
                  Column(
                    mainAxisAlignment: MainAxisAlignment.center,
//                      textDirection: TextDirection.,
                    children: [
                      Image(
                        height: 50,
                        width: 50,
                        image:AssetImage("images/renwu.png"),),
                      Text("巡检任务",style: TextStyle(color: Color(0xFF8B8B8B),fontSize: 12),),

                    ],
                  ),
                ),),
              InkWell(
                onTap: (){
                  Navigator.push(context, MaterialPageRoute(builder: (context) {
                    return new PointRecordScreen2();
                  }));
                },
                child:
                Container(
                  width: 80,
                  child:
                  Column(
                    mainAxisAlignment: MainAxisAlignment.center,
//                      textDirection: TextDirection.,
                    children: [
                      Image(
                        height: 50,
                        width: 50,
                        image:AssetImage("images/jilu.png"),),
                      Text("打卡记录",style: TextStyle(color: Color(0xFF8B8B8B),fontSize: 12),),

                    ],
                  ),
                ),),
            ],
          ),
        ),

      ),

    );
  }


}